<template>
  <div class="newsinfo">
    <van-panel
      :title="newsInfo.zhaiyao"
      :status="'阅读'+newsInfo.click+'次'"
    >
      <div class="content">{{newsInfo.content}}</div>
    </van-panel>
    <Comment :id="id"></Comment>
  </div>
</template>
<script>
import Comment from '@/components/Comment'
export default {
  props: ['id'],
  data() {
    return {
      newsInfo: {}
    }
  },
  created() {
    this.getNewsInfo()
  },
  methods: {
    async getNewsInfo() {
      const res = await this.$http.getNewsInfo(this.id)
      this.newsInfo = res.data.message
    }
  },
  components: {
    Comment
  }
}
</script>
<style lang="scss" scoped>
.newsinfo {
  padding: 10px;
  .van-cell__title {
    flex: 2;
    font-size: 16px;
    font-weight: 600;
  }
  .content {
    text-indent: 2em;
    font-size: 12px;
  }
}
</style>
